package com.chinasi.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.caland.framework.core.page.Pager;
import com.chinasi.dao.OrgQaDao;
import com.chinasi.model.OrgQa;
import com.chinasi.service.OrgQaService;

@Service
public class OrgQaServiceImpl implements OrgQaService {

	/**
	 * OrgQaDAO
	 */
	@Autowired
	private OrgQaDao orgQaDao;

	@Override
	public Pager findPageByOrgId(String orgId, int currentPage) {
		OrgQa searchBean = new OrgQa();
		searchBean.setOrgId(orgId);
		Pager page = new Pager(orgQaDao.getTotalCount(searchBean));
		page.setCurrentPage(currentPage);
		page.setData(orgQaDao.findByCondition(searchBean, page.getStartRow(),page.getPageSize()));
		return page;
	}
	
}
